package com.iplay.dahua.chapter2.simpleFactory;

/**
 * @author dangwu
 * @since 2021/7/21 3:11 下午
 */
public class CashFactory {

    public static BaseCashSuper createCashAccept(String type) {
        BaseCashSuper bcs = null;
        switch (type) {
            case "1":
                bcs = new CashNormal();
                break;
            case "2":
                bcs = new CashRebate(0.8);
                break;
            case "3":
                bcs = new CashReturn(300, 100);
                break;
            default:
                break;
        }
        return bcs;
    }
}
